1. Field of the Invention
The present invention relates to a microprocessor, and more particularly to an input/output port for bit processing operation.
2. Description of the Related Art
As shown in FIG. 1 of the accompanying drawings, the conventional 8-bit microprocessor has, for each bit, an input/output port which comprises an input/output port terminal 24, an internal bus 25 for inputting data into the microprocessor and outputting data from the microprocessor, a mode register 26 for selecting an input mode or an output mode according to data set by a write signal 27 from the internal bus 25, an output latch 28 for holding output data set by a write signal 29, a NAND gate 36 inputting a read signal 31 and a signal from the input/output port terminal 24 in an input mode, inverters 32, 34, and buffers 33, 35. The 8-bit microprocessor has a total of eight such input/output ports for inputting data from and outputting data to an input/output device (not shown).
Operation of the input/output port for processing one-bit data in an output mode will be described below with reference to FIGS. 1 and 2 of the accompanying drawings.
It is assumed that two clock pulses are required to read data held by the output latch 28 into a CPU (not shown) through the internal bus 25 in response to the read signal 30 two clock pulses to write data from the CPU through the internal bus 25 into the output latch 28 in response to the write signal 29, and one clock pulse for the CPU to process the data.
When the read signal 30 is applied, the data held by the output latch 28 is read into an ALU of the CPU during the period of clock pulses A, B. The ALU processes the data during the period of a clock pulse C, and then the processed data is written into the output latch 28 during the period of clock pulses D, E when the write signal 29 is applied.
Since the data latched by the output latch 28 is first read and then processed by the ALU of the CPU, as described above, the conventional microprocessor requires a relatively long time, i.e., a relatively large number of clock pulses, for inputting and outputting desired data.